/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package EA_Model.IEC61970.Wires.impl;

import EA_Model.IEC61970.Core.impl.IdentifiedObjectImpl;

import EA_Model.IEC61970.Domain.Conductance;
import EA_Model.IEC61970.Domain.Length;
import EA_Model.IEC61970.Domain.Reactance;
import EA_Model.IEC61970.Domain.Resistance;
import EA_Model.IEC61970.Domain.Susceptance;

import EA_Model.IEC61970.Wires.MutualCoupling;
import EA_Model.IEC61970.Wires.WiresPackage;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Mutual Coupling</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link EA_Model.IEC61970.Wires.impl.MutualCouplingImpl#getB0ch <em>B0ch</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Wires.impl.MutualCouplingImpl#getDistance11 <em>Distance11</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Wires.impl.MutualCouplingImpl#getDistance12 <em>Distance12</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Wires.impl.MutualCouplingImpl#getDistance21 <em>Distance21</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Wires.impl.MutualCouplingImpl#getDistance22 <em>Distance22</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Wires.impl.MutualCouplingImpl#getG0ch <em>G0ch</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Wires.impl.MutualCouplingImpl#getR0 <em>R0</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Wires.impl.MutualCouplingImpl#getX0 <em>X0</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class MutualCouplingImpl extends IdentifiedObjectImpl implements MutualCoupling {
	/**
	 * The cached value of the '{@link #getB0ch() <em>B0ch</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getB0ch()
	 * @generated
	 * @ordered
	 */
	protected Susceptance b0ch;

	/**
	 * The cached value of the '{@link #getDistance11() <em>Distance11</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getDistance11()
	 * @generated
	 * @ordered
	 */
	protected Length distance11;

	/**
	 * The cached value of the '{@link #getDistance12() <em>Distance12</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getDistance12()
	 * @generated
	 * @ordered
	 */
	protected Length distance12;

	/**
	 * The cached value of the '{@link #getDistance21() <em>Distance21</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getDistance21()
	 * @generated
	 * @ordered
	 */
	protected Length distance21;

	/**
	 * The cached value of the '{@link #getDistance22() <em>Distance22</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getDistance22()
	 * @generated
	 * @ordered
	 */
	protected Length distance22;

	/**
	 * The cached value of the '{@link #getG0ch() <em>G0ch</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getG0ch()
	 * @generated
	 * @ordered
	 */
	protected Conductance g0ch;

	/**
	 * The cached value of the '{@link #getR0() <em>R0</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getR0()
	 * @generated
	 * @ordered
	 */
	protected Resistance r0;

	/**
	 * The cached value of the '{@link #getX0() <em>X0</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getX0()
	 * @generated
	 * @ordered
	 */
	protected Reactance x0;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected MutualCouplingImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return WiresPackage.Literals.MUTUAL_COUPLING;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Susceptance getB0ch() {
		if (b0ch != null && b0ch.eIsProxy()) {
			InternalEObject oldB0ch = (InternalEObject)b0ch;
			b0ch = (Susceptance)eResolveProxy(oldB0ch);
			if (b0ch != oldB0ch) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, WiresPackage.MUTUAL_COUPLING__B0CH, oldB0ch, b0ch));
			}
		}
		return b0ch;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Susceptance basicGetB0ch() {
		return b0ch;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setB0ch(Susceptance newB0ch) {
		Susceptance oldB0ch = b0ch;
		b0ch = newB0ch;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, WiresPackage.MUTUAL_COUPLING__B0CH, oldB0ch, b0ch));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Length getDistance11() {
		if (distance11 != null && distance11.eIsProxy()) {
			InternalEObject oldDistance11 = (InternalEObject)distance11;
			distance11 = (Length)eResolveProxy(oldDistance11);
			if (distance11 != oldDistance11) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, WiresPackage.MUTUAL_COUPLING__DISTANCE11, oldDistance11, distance11));
			}
		}
		return distance11;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Length basicGetDistance11() {
		return distance11;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setDistance11(Length newDistance11) {
		Length oldDistance11 = distance11;
		distance11 = newDistance11;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, WiresPackage.MUTUAL_COUPLING__DISTANCE11, oldDistance11, distance11));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Length getDistance12() {
		if (distance12 != null && distance12.eIsProxy()) {
			InternalEObject oldDistance12 = (InternalEObject)distance12;
			distance12 = (Length)eResolveProxy(oldDistance12);
			if (distance12 != oldDistance12) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, WiresPackage.MUTUAL_COUPLING__DISTANCE12, oldDistance12, distance12));
			}
		}
		return distance12;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Length basicGetDistance12() {
		return distance12;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setDistance12(Length newDistance12) {
		Length oldDistance12 = distance12;
		distance12 = newDistance12;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, WiresPackage.MUTUAL_COUPLING__DISTANCE12, oldDistance12, distance12));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Length getDistance21() {
		if (distance21 != null && distance21.eIsProxy()) {
			InternalEObject oldDistance21 = (InternalEObject)distance21;
			distance21 = (Length)eResolveProxy(oldDistance21);
			if (distance21 != oldDistance21) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, WiresPackage.MUTUAL_COUPLING__DISTANCE21, oldDistance21, distance21));
			}
		}
		return distance21;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Length basicGetDistance21() {
		return distance21;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setDistance21(Length newDistance21) {
		Length oldDistance21 = distance21;
		distance21 = newDistance21;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, WiresPackage.MUTUAL_COUPLING__DISTANCE21, oldDistance21, distance21));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Length getDistance22() {
		if (distance22 != null && distance22.eIsProxy()) {
			InternalEObject oldDistance22 = (InternalEObject)distance22;
			distance22 = (Length)eResolveProxy(oldDistance22);
			if (distance22 != oldDistance22) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, WiresPackage.MUTUAL_COUPLING__DISTANCE22, oldDistance22, distance22));
			}
		}
		return distance22;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Length basicGetDistance22() {
		return distance22;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setDistance22(Length newDistance22) {
		Length oldDistance22 = distance22;
		distance22 = newDistance22;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, WiresPackage.MUTUAL_COUPLING__DISTANCE22, oldDistance22, distance22));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Conductance getG0ch() {
		if (g0ch != null && g0ch.eIsProxy()) {
			InternalEObject oldG0ch = (InternalEObject)g0ch;
			g0ch = (Conductance)eResolveProxy(oldG0ch);
			if (g0ch != oldG0ch) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, WiresPackage.MUTUAL_COUPLING__G0CH, oldG0ch, g0ch));
			}
		}
		return g0ch;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Conductance basicGetG0ch() {
		return g0ch;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setG0ch(Conductance newG0ch) {
		Conductance oldG0ch = g0ch;
		g0ch = newG0ch;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, WiresPackage.MUTUAL_COUPLING__G0CH, oldG0ch, g0ch));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Resistance getR0() {
		if (r0 != null && r0.eIsProxy()) {
			InternalEObject oldR0 = (InternalEObject)r0;
			r0 = (Resistance)eResolveProxy(oldR0);
			if (r0 != oldR0) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, WiresPackage.MUTUAL_COUPLING__R0, oldR0, r0));
			}
		}
		return r0;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Resistance basicGetR0() {
		return r0;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setR0(Resistance newR0) {
		Resistance oldR0 = r0;
		r0 = newR0;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, WiresPackage.MUTUAL_COUPLING__R0, oldR0, r0));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Reactance getX0() {
		if (x0 != null && x0.eIsProxy()) {
			InternalEObject oldX0 = (InternalEObject)x0;
			x0 = (Reactance)eResolveProxy(oldX0);
			if (x0 != oldX0) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, WiresPackage.MUTUAL_COUPLING__X0, oldX0, x0));
			}
		}
		return x0;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Reactance basicGetX0() {
		return x0;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setX0(Reactance newX0) {
		Reactance oldX0 = x0;
		x0 = newX0;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, WiresPackage.MUTUAL_COUPLING__X0, oldX0, x0));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case WiresPackage.MUTUAL_COUPLING__B0CH:
				if (resolve) return getB0ch();
				return basicGetB0ch();
			case WiresPackage.MUTUAL_COUPLING__DISTANCE11:
				if (resolve) return getDistance11();
				return basicGetDistance11();
			case WiresPackage.MUTUAL_COUPLING__DISTANCE12:
				if (resolve) return getDistance12();
				return basicGetDistance12();
			case WiresPackage.MUTUAL_COUPLING__DISTANCE21:
				if (resolve) return getDistance21();
				return basicGetDistance21();
			case WiresPackage.MUTUAL_COUPLING__DISTANCE22:
				if (resolve) return getDistance22();
				return basicGetDistance22();
			case WiresPackage.MUTUAL_COUPLING__G0CH:
				if (resolve) return getG0ch();
				return basicGetG0ch();
			case WiresPackage.MUTUAL_COUPLING__R0:
				if (resolve) return getR0();
				return basicGetR0();
			case WiresPackage.MUTUAL_COUPLING__X0:
				if (resolve) return getX0();
				return basicGetX0();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case WiresPackage.MUTUAL_COUPLING__B0CH:
				setB0ch((Susceptance)newValue);
				return;
			case WiresPackage.MUTUAL_COUPLING__DISTANCE11:
				setDistance11((Length)newValue);
				return;
			case WiresPackage.MUTUAL_COUPLING__DISTANCE12:
				setDistance12((Length)newValue);
				return;
			case WiresPackage.MUTUAL_COUPLING__DISTANCE21:
				setDistance21((Length)newValue);
				return;
			case WiresPackage.MUTUAL_COUPLING__DISTANCE22:
				setDistance22((Length)newValue);
				return;
			case WiresPackage.MUTUAL_COUPLING__G0CH:
				setG0ch((Conductance)newValue);
				return;
			case WiresPackage.MUTUAL_COUPLING__R0:
				setR0((Resistance)newValue);
				return;
			case WiresPackage.MUTUAL_COUPLING__X0:
				setX0((Reactance)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case WiresPackage.MUTUAL_COUPLING__B0CH:
				setB0ch((Susceptance)null);
				return;
			case WiresPackage.MUTUAL_COUPLING__DISTANCE11:
				setDistance11((Length)null);
				return;
			case WiresPackage.MUTUAL_COUPLING__DISTANCE12:
				setDistance12((Length)null);
				return;
			case WiresPackage.MUTUAL_COUPLING__DISTANCE21:
				setDistance21((Length)null);
				return;
			case WiresPackage.MUTUAL_COUPLING__DISTANCE22:
				setDistance22((Length)null);
				return;
			case WiresPackage.MUTUAL_COUPLING__G0CH:
				setG0ch((Conductance)null);
				return;
			case WiresPackage.MUTUAL_COUPLING__R0:
				setR0((Resistance)null);
				return;
			case WiresPackage.MUTUAL_COUPLING__X0:
				setX0((Reactance)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case WiresPackage.MUTUAL_COUPLING__B0CH:
				return b0ch != null;
			case WiresPackage.MUTUAL_COUPLING__DISTANCE11:
				return distance11 != null;
			case WiresPackage.MUTUAL_COUPLING__DISTANCE12:
				return distance12 != null;
			case WiresPackage.MUTUAL_COUPLING__DISTANCE21:
				return distance21 != null;
			case WiresPackage.MUTUAL_COUPLING__DISTANCE22:
				return distance22 != null;
			case WiresPackage.MUTUAL_COUPLING__G0CH:
				return g0ch != null;
			case WiresPackage.MUTUAL_COUPLING__R0:
				return r0 != null;
			case WiresPackage.MUTUAL_COUPLING__X0:
				return x0 != null;
		}
		return super.eIsSet(featureID);
	}

} //MutualCouplingImpl
